﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using ExpenseSystem.Common;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.DepartmentModules
{
    public class DepartmentBaseManager:DepartmentManager
    {
        protected UserProfile userProfile = Authority.Authority.GetUserProfile();
        public override bool Delete(DepartmentModel department, out string message)
        {
            DepartmentFetcher fetcher = new DepartmentFetcher();
            return updater.Remove(department, tran, fetcher, out message);
        }

        public override bool DeleteById(long[] department,out string message)
        {
            DepartmentFetcher fetcher = new DepartmentFetcher();
            return updater.RemoveById(userProfile.SiteId, department, tran, fetcher, out message);
        }

        public override bool Save(DepartmentModel department, out string message, params IAddable<DepartmentModel>[] addable)
        {
            DepartmentFetcher fetcher = new DepartmentFetcher();
            return updater.Save(department, tran, fetcher, out message);
        }
    }
}
